package com.chance.cc.crawler.development.command.publish.bilibili;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.bilibili.realtime.BilibiliNormalCrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.bilibili.trace.BiliBiliCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.bilibili.trace.BilibiliTraceCrawlerJob;
import com.chance.cc.crawler.development.command.script.bitauto.BitAutoWebCrawlerScript;
import com.chance.cc.crawler.development.command.trigger.domain.bilibili.BilibiliSchedulerTrigger;
import org.junit.Test;

/**
 * @author lt
 * @version 1.0
 * @date 2021-02-02 18:10:44
 * @email okprog@sina.com
 */
public class BilibiliPublishCrawlerJob {
    /**
     * bilibili测试发布
     */
    @Test
    public void publishTestCrawlerJob(){
        CrawlerJob crawlerJob = BilibiliNormalCrawlerJob.publishCrawlerSchedulerJobInfo();
        BilibiliSchedulerTrigger.publishBilibiliNormalCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
        BitAutoWebCrawlerScript.publishCrawlerNodeScript();
    }

    /**
     * bilibili视频实时任务
     */
    @Test
    public void publishNormalCrawlerJob(){
        CrawlerJob crawlerJob = BilibiliNormalCrawlerJob.publishCrawlerSchedulerJobInfo();
        BilibiliSchedulerTrigger.publishBilibiliNormalCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    /**
     * bilibili视频回溯7天回复任务
     */
    @Test
    public void publishTraceCrawlerJob(){
        CrawlerJob crawlerJob = BilibiliTraceCrawlerJob.publishCrawlerSchedulerJobInfo();
        BilibiliSchedulerTrigger.publishBilibiliTraceCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }
    /**
     * bilibili视频回溯回复任务
     */
    @Test
    public void publishCommentTraceCrawlerJob(){
        CrawlerJob crawlerJob = BiliBiliCommentTraceCrawlerSchedulerJob.publishCrawlerSchedulerJobInfo();
        BilibiliSchedulerTrigger.publishBilibiliCommentTraceCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

}
